package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsQuoterItemsNewPageUtil extends SeleniumPageUtil {
	public final static By CQA_LINK_SAVA = By.id("Quoter_ItemEdit1_btnSave");
	public final static By CQA_LINK_CLOSE = By.id("Quoter_ItemEdit1_btnDone");
	public final static By CQA_SPAN_TITLE = By.id("Quoter_ItemEdit1_lblHdr");
	public final static By CQA_TD_ITEM_ID = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[1]/td[1]");
	public final static By CQA_INPUT_ITEM_ID = By.id("Quoter_ItemEdit1_txtItemID");
	public final static By CQA_TD_QUOABLE = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[2]/table/tbody/tr[1]/td[1]");
	public final static By CQA_CHECKBOX_QUOABLE = By.id("Quoter_ItemEdit1_chkQuotable");
	public final static By CQA_TD_RENEWAL = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[2]/table/tbody/tr[1]/td[3]");
	public final static By CQA_CHECKBOX_RENEWAL = By.id("Quoter_ItemEdit1_chkPricingReviewFlag");
	public final static By CQA_TD_ITEM_CLASS = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[2]/td[1]");
	public final static By CQA_SELECT_ITEM_CLASS = By.id("Quoter_ItemEdit1_cboMASItemClassKey");
	public final static By CQA_TD_DEFAULT = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[2]/td[3]");
	public final static By CQA_SELECT_DEFAULT = By.id("Quoter_ItemEdit1_cboSrvDealer");
	public final static By CQA_TD_BNR = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[2]/table/tbody/tr[2]/td[1]");
	public final static By CQA_CHECKBOX_BNR = By.id("Quoter_ItemEdit1_chkBOMNotReqdFlag");
	public final static By CQA_TD_GENERIC_ITEM = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[2]/table/tbody/tr[2]/td[3]");
	public final static By CQA_CHECKBOX_GENERIC_ITEM = By.id("Quoter_ItemEdit1_chkGenericItemFlag");
	public final static By CQA_TD_ITEM_TYPE = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[3]/td[1]");
	public final static By CQA_SELECT_ITEM_TYPE = By.id("Quoter_ItemEdit1_cboItemType");
	public final static By CQA_TD_MFG = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[3]/td[3]");
	public final static By CQA_SELECT_MFG = By.id("Quoter_ItemEdit1_cboMfgCodeID");
	public final static By CQA_TD_RCP = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[2]/table/tbody/tr[3]/td[1]");
	public final static By CQA_CHECKBOX_RCP = By.id("Quoter_ItemEdit1_chkRISCFlag");
	public final static By CQA_TD_LEVEL = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[2]/table/tbody/tr[3]/td[3]");
	public final static By CQA_CHECKBOX_LEVEL = By.id("Quoter_ItemEdit1_chkTopLevelFlag");
	public final static By CQA_TD_RATE = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[4]/td[1]");
	public final static By CQA_INPUT_RATE = By.id("Quoter_ItemEdit1_txtRate");
	public final static By CQA_TD_WRTY_RATE = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[4]/td[3]");
	public final static By CQA_INPUT_WRTY_RATE = By.id("Quoter_ItemEdit1_txtWrtyRate");
	public final static By CQA_TD_RNR = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[2]/table/tbody/tr[4]/td[1]");
	public final static By CQA_CHECKBOX_RNR = By.id("Quoter_ItemEdit1_chkRateNotReqdFlag");
	public final static By CQA_TD_TRACK = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[5]/td[1]");
	public final static By CQA_CHECKBOX_TRACK = By.id("Quoter_ItemEdit1_cboTrackMeth");
	public final static By CQA_TD_SPARE_RANGE = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[5]/td[3]");
	public final static By CQA_CHECKBOX_SPARE_RANGE = By.id("Quoter_ItemEdit1_cboSpareRangeKey");
	public final static By CQA_TD_SUB_ASS = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[6]/td[1]");
	public final static By CQA_INPUT_SUB_ASS = By.id("Quoter_ItemEdit1_txtNextAssembly_UserFld5");
	public final static By CQA_TD_REFER = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[6]/td[3]");
	public final static By CQA_INPUT_REFER = By.id("Quoter_ItemEdit1_txtReferences_UserFld6");
	public final static By CQA_TD_DESC = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[7]/td[1]");
	public final static By CQA_INPUT_DESC = By.id("Quoter_ItemEdit1_txtShortDesc");
	public final static By CQA_TD_PRIMARY_ITEM = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[8]/td[1]");
	public final static By CQA_INPUT_PRIMARY_ITEM = By.id("Quoter_ItemEdit1_txtPrimaryItemID");
	public final static By CQA_TD_COM_CODE = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[9]/td[1]");
	public final static By CQA_SELECT_COM_CODE = By.id("Quoter_ItemEdit1_cboCommodityCode");
	public final static By CQA_TD_LONG_DESC = By.xpath("//*[@id='Quoter_ItemEdit1_pnlPage']/table[2]/tbody/tr/td[1]/table/tbody/tr[10]/td[1]");
	public final static By CQA_TEXTAREA_LONG_DESC = By.id("Quoter_ItemEdit1_txtLongDesc");
	public static void enter(){
		SpContractsQuoterPageUtil.enter();
		SpContractsQuoterPageUtil.displayHidenMenus(new By[]{SpContractsQuoterPageUtil.STQ_LINK_ITEM});
		SeleniumUtil.waitOnElements(new By[]{SpContractsQuoterPageUtil.STQ_LINK_ITEM_NEW});
		SeleniumUtil.click(SeleniumUtil.getCachedElement(SpContractsQuoterPageUtil.STQ_LINK_ITEM_NEW));
		SeleniumUtil.waitForFixedMilliseconds(1000);
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CQA_LINK_SAVA,CQA_TEXTAREA_LONG_DESC
		});
	}
}
